package ru.compft.common.aop;

import org.springframework.stereotype.Service;

/**
 * User: ASUS
 * Date: 02.11.12
 * Time: 9:36
 */
@Service
public class SomeTestServiceImpl implements SomeTestService {
    @Override
    public void executeOperation1() {
        System.out.println("executeOperation1 ");
        executeAction1Operation1();
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        executeAction2Operation1();
        try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        executeAction3Operation1();
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeOperation2() {
        System.out.println("executeOperation2");
        executeAction1Operation2();
        executeAction2Operation2();
        executeAction3Operation2();
    }

    @Override
    public void executeOperation3() {
        System.out.println("executeOperation3");
        executeAction1Operation3();
        executeAction2Operation3();
        executeAction3Operation3();
    }

    @Override
    public void executeAction1Operation1() {
        System.out.println("executeAction1Operation1");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction2Operation1() {
        System.out.println("executeAction2Operation1");
        try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction3Operation1() {
        System.out.println("executeAction3Operation1");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction1Operation2() {
        System.out.println("executeAction1Operation2");
        try {
            Thread.sleep(500L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction2Operation2() {
        System.out.println("executeAction2Operation2");
        try {
            Thread.sleep(3000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction3Operation2() {
        System.out.println("executeAction3Operation2");
        try {
            Thread.sleep(4000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction1Operation3() {
        System.out.println("executeAction1Operation3");
        try {
            Thread.sleep(500L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction2Operation3() {
        System.out.println("executeAction2Operation3");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    @Override
    public void executeAction3Operation3() {
        System.out.println("executeAction3Operation3");
        try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }
}
